package com.group4.xiao_ge_lai_yi_zhu.entry;

import com.group4.xiao_ge_lai_yi_zhu.controller.change_prize_controller.JiShiQi;
import com.group4.xiao_ge_lai_yi_zhu.controller.login_controller.LoginPage;
import com.group4.xiao_ge_lai_yi_zhu.controller.register_controller.RegisterPage;

import java.util.Scanner;
import java.util.Timer;

/**
 * 程序的入口类
 */
public class Entry {

    public static void main(String[] args) {
        Entry entry = new Entry();
        kaiJiang();
        entry.entry();
    }

    //开奖功能-->使用计时器
    public static String[] kaiJiang() {
        Timer timer = new Timer();
        JiShiQi jiShiQi = new JiShiQi();
        timer.schedule(jiShiQi, 0, 60000);
        String[] nums = jiShiQi.nums;
        return nums;
    }

    public void entry() {
        Scanner sc = new Scanner(System.in);
        RegisterPage registerPage = new RegisterPage();
        while (true) {
            System.out.println("请选择要做的操作:");
            System.out.println("1.注册" + "\t\t" + "2.登录" + "\t\t" + "3.退出");
            System.out.println("==============================");
            String select = sc.nextLine();
            switch (select) {
                case "1":
                    System.out.println("注册");
                    registerPage.register();
                    break;
                case "2":
                    System.out.println("登录");
                    LoginPage loginPage = new LoginPage();
                    loginPage.login();
                    break;
                case "3":
                    System.exit(0);
                    break;
                default:
                    System.out.println("您的输入有误!");
                    break;
            }
        }
    }
}
